<?php
/**
 * Created by wb.ssc.
 * User: xuewl
 * Date: 2018/10/16
 * Time: 14:18
 */

namespace app\common\command;
use think\swoole\Server;

class Swoole extends Server
{
    protected $host = '127.0.0.1';
    protected $port = 9502;
    protected $option = [
        'worker_num'=> 4,
        'daemonize'	=> true,
        'backlog'	=> 128
    ];


    public function onOpen($server, $request) {

    }

    public function onReceive($server, $fd, $from_id, $data)
    {
        $server->send($fd, 'Swoole: '.$data);
    }




}
